%h2
  = event.name
  = !event.metro_area.nil? ? " (#{event.metro_area.to_s})" : ''

- if (logged_in? && (event.user.eql?(current_user) || admin?))
  %p
    = link_to :show.l, event_path(event), :class => 'btn btn-default'
    = link_to :clone.l, clone_event_path(event), :class => 'btn btn-success'
    = link_to :edit.l, edit_event_path(event), :class => 'btn btn-warning'
    = link_to :delete.l, event_path(event), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'

%dl.dl-horizontal
  %dt=:when.l
  %dd=event.time_and_date
  - unless event.location.blank?
    %dt= :where.l+":"
    %dd
      = event.location
      = link_to :map_it.l, "http://www.google.com/maps?q=#{URI::encode(event.location)}", :title=>:map_it.l, :target=>'_blank'
  - if event.allow_rsvp?
    %dt=:rsvps.l
    - attending = event.attendees_count == 1 ? :is_attending_this_event.l : :are_attending_this_event.l
    %dd
      = pluralize(event.attendees_count, 'person') + ' ' + attending
      .btn-group
        - if event.end_time > Time.now
          - if rsvp = event.rsvped?(current_user)
            = link_to :retract_rsvp.l, [event, rsvp], data: { confirm: :are_you_sure.l }, :method=>:delete, :class => 'btn btn-primary btn-xs'
            = link_to :update_rsvp.l, edit_event_rsvp_url(event, rsvp), :class => 'btn btn-primary btn-xs'
          - else
            = link_to :rsvp.l, new_event_rsvp_url(event), :class => 'btn btn-primary btn-xs'
- if show_details_link
  %p= link_to :event_details.l, event_url(event)

